# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: banbanchs <memory.silentvoyage@gmail.com>

pkgname=libcork
pkgver=0.15.0
pkgrel=3
pkgdesc="A simple, easily embeddable cross-platform C library"
arch=('loong64' 'x86_64')
url="https://github.com/redjack/libcork"
license=('BSD')
depends=('glibc')
makedepends=('cmake' 'check' 'git')
checkdepends=('python')
source=("git+https://github.com/redjack/libcork.git#tag=$pkgver")
sha256sums=('SKIP')

prepare() {
  mkdir build
}

build() {
  cd build
  cmake ../libcork -DCMAKE_INSTALL_PREFIX=/usr
  make
}

check() {
  cd build
  make test
}

package() {
  cd build
  make DESTDIR="$pkgdir/" install

  install -Dm644 "$srcdir"/$pkgname/COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
